home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / editors / CED / rexx / CED_ErrorParse.rexx next >
Encoding:
OS/2 REXX Batch file  |  1995-12-24  |  1.8 KB  |  83 lines

  1. /*
  2. **      $Id: CED_ErrorParse.rexx,v 30.0 1994/06/10 18:06:05 dice Exp $
  3. **
  4. **      DICE Error Parsing Script.  Script for Oxxi TurboText (tm).
  5. **
  6. **  Notes: This assumes that your DCC:Config/DCC.Config file contains the
  7. **         following line:
  8. **  cmd= rx DCC:Rexx/TTX_ErrorParse.rexx %e "%c" "%f" "%0"
  9. */
  10.  
  11. OPTIONS RESULTS
  12.  
  13. PARSE ARG EFile '"' Fn '" "' CurDir '" "' CFile '" "' VPort '"'
  14. IF VPort = '?' THEN VPort = ''
  15.  
  16. portname = 'DICE_ERROR_PARSER'  /* DICEHelp's port name */
  17.  
  18. if ~show('p',portname) then
  19.    do
  20.       address COMMAND 'RUN >NIL: <NIL: DError REXXSTARTUP'
  21.  
  22.       do i = 1 to 6
  23.          if ~show('p',portname) then
  24.             address COMMAND 'wait 1'
  25.       end
  26.  
  27.       if ~show('p',portname) then
  28.          do
  29.             say "Dice Error Parser (DERROR) program not found!"
  30.             address COMMAND 'type' EFile
  31.             exit
  32.          end
  33.    end
  34.  
  35. /*
  36.  
  37. /**
  38.  ** Get the error messages loaded in.
  39.  ** This will return a list of lines within the file that have
  40.  ** errors associated with them (if any)
  41.  **/
  42. ADDRESS DICE_ERROR_PARSER LOAD EFile '"'CurDir'" "'Fn'" "'VPort'"'
  43. LINES = RESULT
  44.  
  45. /**
  46.  ** go to the first error message
  47.  **/
  48.  
  49. ADDRESS DICE_ERROR_PARSER Current E
  50. IF rc ~= 0 THEN
  51.    DO
  52.       'DM No More Errors'
  53.       exit 0
  54.    END
  55.  
  56. IF E.LINE = 0 THEN
  57.    DO
  58.    IF LEFT(E.TEXT, 5) = 'DLINK' THEN
  59.       DO
  60.          TT = TRANSLATE(E.STRING, '-', '"')
  61.          /* This is a DLINK error, we need to handle it special */
  62.          SAY 'There were DLINK Errors'
  63.          ADDRESS COMMAND TYPE EFILE
  64.          exit 0
  65.       END
  66.    END
  67.  
  68. ADDRESS COMMAND 'ed' E.FPATH '-i'
  69. IF RC ~= 0 THEN
  70.    DO
  71.       Say 'Unable to open' E.FPATH
  72.       exit 0
  73.    END
  74.  
  75. do i = 1 to 6
  76.    if ~show('p','rexx_ced') then
  77.       address COMMAND 'wait 1'
  78. end
  79.  
  80. ADDRESS 'rexx_ced'
  81. 'jump to line' E.line    /* Jump straight to the line number. */
  82. 'DM' E.STRING
  83.